package com.gko100.action.front;

import java.util.ArrayList;

import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import com.gko100.action.base.AdminBaseAction;
import com.gko100.model.Article;
import com.gko100.model.Disease;
import com.gko100.model.Image;
import com.gko100.model.Language;
import com.gko100.model.Navigation;
import com.gko100.vo.ArtiFrontAndNext;
import com.gko100.vo.DiseArtiSite;
import com.gko100.vo.NavigationVo;
import com.gko100.vo.NewsArti;
import com.opensymphony.xwork2.ActionContext;

public class FrontQueryAction extends AdminBaseAction {
	
	private static int pageSize=20;
	private long totalCount;
	private int pageNo;
	private int pageCount;
	public int getPageSize() {
		return pageSize;
	}
	
	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}


	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getPageCount() {
		return pageCount;
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	//导航分类对象
	private Navigation nav;
	
	public Navigation getNav() {
		return nav;
	}
	public void setNav(Navigation nav) {
		this.nav = nav;
	}

	//文章信息对象
	private Article arti;
	private List<Article> artiList;
	public Article getArti() {
		return arti;
	}
	public void setArti(Article arti) {
		this.arti = arti;
	}
	public List<Article> getArtiList() {
		return artiList;
	}
	public void setArtiList(List<Article> artiList) {
		this.artiList = artiList;
	}
	
	private List<NavigationVo> navVoList;
	
	public List<NavigationVo> getNavVoList() {
		return navVoList;
	}

	public void setNavVoList(List<NavigationVo> navVoList) {
		this.navVoList = navVoList;
	}

	//前台行业知识----新闻报道vo对象
	
	private List<NewsArti> newsArtiList;
	public List<NewsArti> getNewsArtiList() {
		return newsArtiList;
	}
	public void setNewsArtiList(List<NewsArti> newsArtiList) {
		this.newsArtiList = newsArtiList;
	}
	
	
	
	

	//链接导航对象对象------上一篇、下一篇
	private ArtiFrontAndNext artiFAN;
	
	public ArtiFrontAndNext getArtiFAN() {
		return artiFAN;
	}
	public void setArtiFAN(ArtiFrontAndNext artiFAN) {
		this.artiFAN = artiFAN;
	}
	
	//查找单篇文章
	public String find_artiByArtiId() throws Exception{
		
		if(this.getNav()!=null){
			this.setNav(null);
		}
		if(this.getArtiFAN()!=null){
			this.setArtiFAN(null);
		}
		if(this.getArti().getArtiId()!=null){
			
			Article arti = adminManager.findArtiByArtiId(this.getArti().getArtiId());
			
			if(arti!=null){
				
				arti.setClickNums(arti.getClickNums()+1);
				adminManager.modify_arti(arti);
				this.setArti(arti);
				Navigation nav = arti.getNav();
				
				//您所在的位置
				if(nav!=null){
					List<NavigationVo> nVoList = new ArrayList<NavigationVo>();
					if(nav.getNavPid()!=0){
						NavigationVo nVo = new NavigationVo();
						Navigation n1 = adminManager.findNavByNavId(nav.getNavPid());
						if(n1.getNavPid()!=0){
							NavigationVo nVo1 = new NavigationVo();
							
							Navigation n2 = adminManager.findNavByNavId(n1.getNavPid());
							if(n2!=null&&n2.getNavPid()==0){
								NavigationVo nVo2 = new NavigationVo();
								nVo2.setId(n2.getNavId());
								nVo2.setName(n2.getNavName());
								
								nVo2.setUrl(n2.getNavUrl());
								nVo1.setId(n1.getNavId());
								nVo1.setName(n1.getNavName());
								
								nVo1.setUrl(n1.getNavUrl());
								nVo.setId(nav.getNavId());
								nVo.setName(nav.getNavName());
								
								nVo.setUrl(nav.getNavUrl());
								
								nVoList.add(nVo2);
								nVoList.add(nVo1);
								nVoList.add(nVo);
							}
						}else if(n1.getNavPid()==0){
							NavigationVo nVo1 = new NavigationVo();
							nVo1.setId(n1.getNavId());
							nVo1.setName(n1.getNavName());
							
							nVo1.setUrl(n1.getNavUrl());
							nVo.setId(nav.getNavId());
							nVo.setName(nav.getNavName());
							
							nVo.setUrl(nav.getNavUrl());
							nVoList.add(nVo1);
							nVoList.add(nVo);
							
						}
					}else if(nav.getNavPid()==0){
						
						NavigationVo nVo = new NavigationVo();
						nVo.setId(nav.getNavId());
						nVo.setName(nav.getNavName());
						
						nVo.setUrl(nav.getNavUrl());
						nVoList.add(nVo);
					}
					
					if(nVoList!=null){
						this.setNavVoList(nVoList);
						nVoList = null;
					}
					
					//上一篇、下一篇
					int offset = 0;
					int pageSize = 1;
					List<Article> afList = adminManager.findArtiFront(nav, arti.getArtiId(), offset, pageSize);
					List<Article> anList = adminManager.findArtiNext(nav, arti.getArtiId(), offset, pageSize);
					ArtiFrontAndNext afan = new ArtiFrontAndNext();
					if(afList!=null&&afList.size()==1){

						Article aFront = afList.get(0);
						if(aFront!=null){
							
							afan.setAFrontId(aFront.getArtiId());
							afan.setAFrontTitle(aFront.getArtiTitle());
						}
						
					}
					if(anList!=null&&anList.size()==1){
						
						Article aNext = anList.get(0);
						if(aNext!=null){
							
							afan.setANextId(aNext.getArtiId());
							afan.setANextTitle(aNext.getArtiTitle());
						}
						
					}
					
					if(afan!=null){	
						this.setArtiFAN(afan);
						afan = null;
					}
				}
			}	
		}
		return "artiByArtiId_find_success";
	}
	
	//查找分类列表下文章
	
	public List<Navigation> cycleNavList(Navigation nav){
		
		if(nav!=null){
			
			List<Navigation> navList = adminManager.findNavListByNavPId(nav.getNavId());
			if(navList!=null&&navList.size()>=1){
				for(int i=0;i<navList.size();i++){
					
					List<Navigation> nl = this.cycleNavList(navList.get(i));
					if(nl!=null&&nl.size()>=1){
						navList.addAll(nl);
					}
				}
				return navList;
			}
		}		
		return null;
	}
	
	private Map<Navigation, List<Article>> navArtiMap;
	
	public Map<Navigation, List<Article>> getNavArtiMap() {
		return navArtiMap;
	}

	public void setNavArtiMap(Map<Navigation, List<Article>> navArtiMap) {
		this.navArtiMap = navArtiMap;
	}

	//查找分类下所有文章,分页
	
	public String find_newsAllByNav() throws Exception {

		if(this.getArtiList()!=null){
			this.setArtiList(null);
		}
		if(this.getTotalCount()!=0){
			this.setTotalCount(0);
		}
		if(this.getNewsArtiList()!=null){
			this.setNewsArtiList(null);
		}
		if(this.getNavArtiMap()!=null){
			this.setNavArtiMap(null);
		}
		
		if(this.getNav()!=null&&this.getNav().getNavId()!=null){
			
			Navigation nav = adminManager.findNavByNavId(this.getNav().getNavId());
			if(nav!=null){
				
				this.setNav(nav);
				List<NavigationVo> nVoList = new ArrayList<NavigationVo>();
				if(nav.getNavPid()!=0){
					NavigationVo nVo = new NavigationVo();
					Navigation n1 = adminManager.findNavByNavId(nav.getNavPid());
					if(n1.getNavPid()!=0){
						NavigationVo nVo1 = new NavigationVo();
						
						Navigation n2 = adminManager.findNavByNavId(n1.getNavPid());
						if(n2!=null&&n2.getNavPid()==0){
							NavigationVo nVo2 = new NavigationVo();
		
							nVo2.setId(n2.getNavId());
							nVo2.setName(n2.getNavName());
							nVo2.setUrl(n2.getNavUrl());
							nVo1.setId(n1.getNavId());
							nVo1.setName(n1.getNavName());
							nVo1.setUrl(n1.getNavUrl());
							nVo.setId(nav.getNavId());
							nVo.setName(nav.getNavName());
							nVo.setUrl(nav.getNavUrl());
							
							nVoList.add(nVo2);
							nVoList.add(nVo1);
							nVoList.add(nVo);
							
						}
					}else if(n1.getNavPid()==0){
						NavigationVo nVo1 = new NavigationVo();
						nVo1.setId(n1.getNavId());
						nVo1.setName(n1.getNavName());
						nVo1.setUrl(n1.getNavUrl());
						nVo.setId(nav.getNavId());
						nVo.setName(nav.getNavName());
						nVo.setUrl(nav.getNavUrl());
						nVoList.add(nVo1);
						nVoList.add(nVo);
						
					}
				}else if(nav.getNavPid()==0){
					
					NavigationVo nVo = new NavigationVo();
					nVo.setId(nav.getNavId());
					nVo.setName(nav.getNavName());
					nVo.setUrl(nav.getNavUrl());
					nVoList.add(nVo);
				}
				
				if(nVoList!=null){
					this.setNavVoList(nVoList);
					nVoList = null;
				}
				
				//分页开始
				List<Navigation> navList = this.cycleNavList(this.getNav());
				
				if(navList!=null&&navList.size()>=1){
					
					long totalCount = adminManager.find_artiTotalCountByNav(navList);
					this.setTotalCount(totalCount);
					this.setPageCount((int) (this.getTotalCount()/pageSize+1));
					 
					if(this.getTotalCount()==0){
						this.setPageCount(0);
					}
					if(this.getPageNo()<1){
						this.setPageNo(1);
					}
					if(this.getPageCount()==0){
						this.setPageNo(0);
					}
					if(this.getPageNo()==1){
						int offset = 0;
						List<Article> artiList = adminManager.findArtiListByNavListAndPage(navList, offset, pageSize);
						List<NewsArti> natl = new ArrayList<NewsArti>();
						if(artiList!=null&&artiList.size()>=1){
							
							for(int i=0;i<artiList.size();i++){

								Article a = artiList.get(i);
								NewsArti nat = new NewsArti();
								nat.setId(a.getArtiId());
								nat.setTitle(a.getArtiTitle());
								nat.setAddDate(a.getAddDate());
								nat.setClickNums(a.getClickNums());
								Navigation n = a.getNav();
								if(n!=null){
									
									nat.setNavId(n.getNavId());
									nat.setNavName(n.getNavName());
									nat.setNavUrl(n.getNavUrl());
									
								 }
								
								 natl.add(nat);
							}
						}
						if(natl!=null){
							 this.setNewsArtiList(natl);
							 navList = null;
							 natl = null;
						}
					}
					if(this.getPageNo()>1&&this.getPageNo()<=this.getPageCount()){

						int offset = (this.getPageNo()-1)*this.getPageSize();
						List<Article> artiList = adminManager.findArtiListByNavListAndPage(navList, offset, offset);
						List<NewsArti> natl = new ArrayList<NewsArti>();
						if(artiList!=null&&artiList.size()>=1){
							 
							for(int i=0;i<artiList.size();i++){

								Article a = artiList.get(i);
								NewsArti nat = new NewsArti();
								nat.setId(a.getArtiId());
								nat.setTitle(a.getArtiTitle());
								nat.setAddDate(a.getAddDate());
								nat.setClickNums(a.getClickNums());
								Navigation n = a.getNav();
								if(n!=null){
								
									nat.setNavId(n.getNavId());
									nat.setNavName(n.getNavName());
									nat.setNavUrl(n.getNavUrl());
								
								}
								
								natl.add(nat);
							}
						}
						 
						if(natl!=null){	
							this.setNewsArtiList(natl);
							natl = null;
						}
					}
					
				}else{
					
					//分页开始
					List<Navigation> nl = new ArrayList<Navigation>();
					nl.add(nav);
					long totalCount = adminManager.find_artiTotalCountByNav(nl);
					this.setTotalCount(totalCount);
					this.setPageCount((int) (this.getTotalCount()/pageSize+1));
					
					if(this.getTotalCount()==0){
						this.setPageCount(0);
					}
					if(this.getPageNo()<1){
						this.setPageNo(1);
					}
					if(this.getPageCount()==0){
						this.setPageNo(0);
					}
					if(this.getPageNo()==1){

						int offset = 0;
						List<Article> artiList = adminManager.findArtiListByNavListAndPage(nl, offset, pageSize);
						List<NewsArti> natl = new ArrayList<NewsArti>();
						if(artiList!=null&&artiList.size()>=1){
							
							for(int i=0;i<artiList.size();i++){

								Article a = artiList.get(i);
								NewsArti nat = new NewsArti();
								nat.setId(a.getArtiId());
								nat.setTitle(a.getArtiTitle());
								nat.setAddDate(a.getAddDate());
								nat.setClickNums(a.getClickNums());
								Navigation n = a.getNav();
								if(n!=null){
									
									nat.setNavId(n.getNavId());
									nat.setNavName(n.getNavName());
									nat.setNavUrl(n.getNavUrl());
									
								 }
								
								 natl.add(nat);
							}
						 }
						 
						 if(natl!=null){
							
							 this.setNewsArtiList(natl);
							 natl = null;
						 }	
						 nl = null;
					}
					if(this.getPageNo()>1&&this.getPageNo()<=this.getPageCount()){

						int offset = (this.getPageNo()-1)*this.getPageSize();
						List<Article> artiList = adminManager.findArtiListByNavListAndPage(nl, offset, pageSize);
						List<NewsArti> natl = new ArrayList<NewsArti>();
						if(artiList!=null&&artiList.size()>=1){
							 
							for(int i=0;i<artiList.size();i++){

								Article a = artiList.get(i);
								NewsArti nat = new NewsArti();
								nat.setId(a.getArtiId());
								nat.setTitle(a.getArtiTitle());
								nat.setAddDate(a.getAddDate());
								nat.setClickNums(a.getClickNums());
								Navigation n = a.getNav();
								if(n!=null){
								
									nat.setNavId(n.getNavId());
									nat.setNavName(n.getNavName());
									nat.setNavUrl(n.getNavUrl());
								
								}
								
								natl.add(nat);
							}
						}
						if(natl!=null){	
							this.setNewsArtiList(natl);
							natl = null;
						}
						nl = null;
					}
				}
			}	
		}

		return "newsAllByNav_find_success";
	}
	
	

	
	//搜索 按关键字搜索
	
	private String searchKey;
	
	public String getSearchKey() {
		return searchKey;
	}

	public void setSearchKey(String searchKey) {
		this.searchKey = searchKey;
	}
	private List<NewsArti> natlSearch;
	
	public List<NewsArti> getNatlSearch() {
		return natlSearch;
	}

	public void setNatlSearch(List<NewsArti> natlSearch) {
		this.natlSearch = natlSearch;
	}

	public String search_artiList() throws Exception {
		
		if(this.getNav()!=null){
			this.setNav(null);
		}
		if(this.getNewsArtiList()!=null){
			this.setNewsArtiList(null);
		}
		if(this.getSearchKey()!=null){

			 long totalCount = adminManager.find_totalCountBySearchKey(searchKey);
			 this.setTotalCount(totalCount);
			 this.setPageCount((int) (this.getTotalCount()/pageSize+1));
			 
			 if(this.getTotalCount()==0){
				 this.setPageCount(0);
			 }
			 if(this.getPageNo()<1){
				 this.setPageNo(1);
			 }
			 
			 if(this.getPageCount()==0){
				this.setPageNo(0);
			 }

			 if(this.getPageNo()==1){
				
				 int offset = 0;
				 List<Article> artiList = adminManager.find_artiListBySearchKeyAndPage(this.getSearchKey(), offset, pageSize);
				 List<NewsArti> natl = new ArrayList<NewsArti>();
				 if(artiList!=null&&artiList.size()>=1){
					 
					 for(int i=0;i<artiList.size();i++){

						 Article a = artiList.get(i);
						 NewsArti nat = new NewsArti();
						 nat.setId(a.getArtiId());
						 nat.setTitle(a.getArtiTitle());
						 nat.setAddDate(a.getAddDate());
						 nat.setClickNums(a.getClickNums());
						 Navigation n = a.getNav();
						 if(n!=null){
							
							 nat.setNavId(n.getNavId());
							 nat.setNavName(n.getNavName());
							 nat.setNavUrl(n.getNavUrl());
							
						 }
						
						 natl.add(nat);
					}
				 }
				 
				 if(natl!=null){
					
					 this.setNewsArtiList(natl);
					 natl = null;
				 }

			}
			if(this.getPageNo()>1&&this.getPageNo()<=this.getPageCount()){

				
				List<NewsArti> nal = new ArrayList<NewsArti>();	
				int offset = (this.getPageNo()-1)*this.getPageSize();
				List<Article> artiList = adminManager.find_artiListBySearchKeyAndPage(this.getSearchKey(), offset, pageSize);
				List<NewsArti> natl = new ArrayList<NewsArti>();
				if(artiList!=null&&artiList.size()>=1){
					 
					for(int i=0;i<artiList.size();i++){

						Article a = artiList.get(i);
						NewsArti nat = new NewsArti();
						nat.setId(a.getArtiId());
						nat.setTitle(a.getArtiTitle());
						nat.setAddDate(a.getAddDate());
						nat.setClickNums(a.getClickNums());
						Navigation n = a.getNav();
						if(n!=null){
						
							nat.setNavId(n.getNavId());
							nat.setNavName(n.getNavName());
							nat.setNavUrl(n.getNavUrl());
						
						}
						
						natl.add(nat);
					}
				}
				 
				if(natl!=null){	
					this.setNewsArtiList(natl);
					natl = null;
				}
			}
		}
		
		return "artiList_search_success";
	}
	
	//根据疾病分类查找相关信息
	private Disease disease;
	private Map<Disease, List<NewsArti>> diseNewsArtiMap;

	public Disease getDisease() {
		return disease;
	}
	public void setDisease(Disease disease) {
		this.disease = disease;
	}
	public Map<Disease, List<NewsArti>> getDiseNewsArtiMap() {
		return diseNewsArtiMap;
	}

	public void setDiseNewsArtiMap(Map<Disease, List<NewsArti>> diseNewsArtiMap) {
		this.diseNewsArtiMap = diseNewsArtiMap;
	}
	
	public String find_newsAllByDise() throws Exception {
		
		
		if(this.getArtiList()!=null){
			this.setArtiList(null);
		}
		if(this.getTotalCount()!=0){
			this.setTotalCount(0);
		}
		if(this.getNewsArtiList()!=null){
			this.setNewsArtiList(null);
		}
		
		String langName = null;
		if(Locale.getDefault().equals(Locale.CHINA)){
			
			langName = "zh_cn";
			
		}else if(Locale.getDefault().equals(Locale.US)){
			
			langName = "en_us";
			
		}
		if(this.getNav().getNavId()!=null){
			
			Navigation nav = adminManager.findNavByNavId(this.getNav().getNavId());
			if(nav!=null){
				
				this.setNav(nav);
				Language lang = adminManager.findLangByLangName(langName);
				List<Disease> diseList = adminManager.findDisListByDisPidAndLang(0, lang);
				Map<Disease, List<NewsArti>> dnaMap = new LinkedHashMap<Disease, List<NewsArti>>();
				if(diseList!=null&&diseList.size()>=1){
					
					for(int i=0;i<diseList.size();i++){
						
						List<Disease> dList = adminManager.findDisListByDisPid(diseList.get(i).getDiseaseId());
						if(dList!=null&&dList.size()>=1){
							
							List<NewsArti> dnaList = new ArrayList<NewsArti>();

							List<Article> al = adminManager.findArtiListByDisAndNav(dList, nav);
							
							NewsArti na = new NewsArti();
							if(al!=null&&al.size()>=1){
								
								na.setId(al.get(0).getArtiId());
								na.setTitle(al.get(0).getArtiTitle());
								na.setClickNums(al.get(0).getClickNums());
								na.setDiseaseId(diseList.get(i).getDiseaseId());
								na.setDiseTitle(diseList.get(i).getTitle());
								na.setDiseUrl(diseList.get(i).getUrl());
								na.setAddDate(al.get(0).getAddDate());
								dnaList.add(na);
							}
							if(dnaList!=null){
								dnaMap.put(diseList.get(i), dnaList);
								dnaList = null;
							}else{
								dnaMap.put(diseList.get(i), null);
							}
						}
					}
				}
				if(dnaMap!=null){
					this.setDiseNewsArtiMap(dnaMap);
					dnaMap = null;
				}
			}
		}
		return "newsAllByDise_find_success";
	}
	
	private DiseArtiSite diseArtiSite;
	private List<DiseArtiSite> diseArtiSiteList;
	private Map<Disease, List<DiseArtiSite>> diseArtiSiteMap;
	
	public DiseArtiSite getDiseArtiSite() {
		return diseArtiSite;
	}

	public void setDiseArtiSite(DiseArtiSite diseArtiSite) {
		this.diseArtiSite = diseArtiSite;
	}

	public List<DiseArtiSite> getDiseArtiSiteList() {
		return diseArtiSiteList;
	}

	public void setDiseArtiSiteList(List<DiseArtiSite> diseArtiSiteList) {
		this.diseArtiSiteList = diseArtiSiteList;
	}

	public Map<Disease, List<DiseArtiSite>> getDiseArtiSiteMap() {
		return diseArtiSiteMap;
	}

	public void setDiseArtiSiteMap(Map<Disease, List<DiseArtiSite>> diseArtiSiteMap) {
		this.diseArtiSiteMap = diseArtiSiteMap;
	}

	public String find_diseDetaileByDise() throws Exception {
		
		if(this.getDiseArtiSiteMap()!=null){
			this.setDiseArtiSiteMap(null);
		}
		String artiNote = "";
		String instNote = "";
		String doctNote = "";
		if(Locale.getDefault().equals(Locale.CHINA)){
			
			artiNote = "sc_cn";
			instNote = "inst_cn";
			doctNote = "doct_cn";
			
		}else if(Locale.getDefault().equals(Locale.US)){
			
			artiNote = "sc_en";
			instNote = "inst_en";
			doctNote = "doct_en";
			
		}
		if(this.getDisease()!=null&&this.getDisease().getDiseaseId()!=null){

			Disease disease = adminManager.findDisByDisId(this.getDisease().getDiseaseId());
			if(disease!=null){
				
				this.setDisease(disease);
				
				List<Disease> diseaseList = adminManager.findDisListByDisPid(disease.getDiseaseId());
				if(diseaseList!=null&&diseaseList.size()>=1){
					
					Map<Disease, List<DiseArtiSite>> dasMap = new LinkedHashMap<Disease, List<DiseArtiSite>>();
					for(int i=0;i<diseaseList.size();i++){
						
						List<Article> artiList = adminManager.findArtiListByDisAndNote(diseaseList.get(i), artiNote);
						List<Article> instList = adminManager.findArtiListByDisAndNote(diseaseList.get(i), instNote);
						List<Article> doctList = adminManager.findArtiListByDisAndNote(diseaseList.get(i), doctNote);
						
						List<DiseArtiSite> dasList = new ArrayList<DiseArtiSite>();
						for(int j=0;j<3;j++){
							
							DiseArtiSite das = new DiseArtiSite();
							if(artiList!=null&&artiList.size()>=1&&j<artiList.size()){
								das.setScId(artiList.get(j).getArtiId());
								
								das.setScTitle(artiList.get(j).getArtiTitle());
								
							}
							if(instList!=null&&instList.size()>=1&&j<instList.size()){
								das.setInstId(instList.get(j).getArtiId());
								
								das.setInstTitle(instList.get(j).getArtiTitle());
							}
							if(doctList!=null&&doctList.size()>=1&&j<doctList.size()){
								das.setDoctId(doctList.get(j).getArtiId());
								Image image = adminManager.findImageByArti(doctList.get(j)).get(0);
								if(image!=null){
									das.setImageSavePath(image.getImgSrcName()+image.getImgSaveName());
								}
								
								das.setDoctTitle(doctList.get(j).getArtiTitle());
							}
							
							if(das!=null){
								dasList.add(das);
							}
							
						}
						
						
						if(dasList!=null){
							dasMap.put(diseaseList.get(i), dasList);
							dasList = null;
						}else{
							dasMap.put(diseaseList.get(i), null);
						}
						
					}
					
					if(dasMap!=null){
						this.setDiseArtiSiteMap(dasMap);
						dasMap = null;
					}
					
				}else{

					List<DiseArtiSite> dasList = new ArrayList<DiseArtiSite>();
					List<Article> artiList = adminManager.findArtiListByDisAndNote(disease, artiNote);
					List<Article> instList =adminManager.findArtiListByDisAndNote(disease, instNote);
					List<Article> doctList =adminManager.findArtiListByDisAndNote(disease, doctNote);
					if(artiList!=null&&instList!=null&&doctList!=null){
						for(int j=0;j<artiList.size()||j<instList.size()||j<doctList.size();j++){
							
							DiseArtiSite das = new DiseArtiSite();
							if(j<artiList.size()){
								das.setScId(artiList.get(j).getArtiId());
								das.setScTitle(artiList.get(j).getArtiTitle());
							}
							if(instList!=null&&instList.size()>=1&&j<instList.size()){
								das.setInstId(instList.get(j).getArtiId());
								das.setInstTitle(instList.get(j).getArtiTitle());
							}
							if(doctList!=null&&doctList.size()>=1&&j<doctList.size()){
								das.setDoctId(doctList.get(j).getArtiId());
								das.setDoctTitle(doctList.get(j).getArtiTitle());
							}
							if(das!=null){
								dasList.add(das);
							}
						}
					}
					if(dasList!=null){
						this.setDiseArtiSiteList(dasList);
						dasList = null;
					}
				}
			}
		}

		return "diseDetaileByDise_find_success";
	}
	


}
